package com.platform.service;

import com.platform.dao.*;
import com.platform.entity.CreatWxuserOrderDto;
import com.platform.entity.CreateWxuserOrderGoodsDto;
import com.platform.entity.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ApiOrderService {
    @Autowired
    private ApiOrderMapper orderDao;

    public OrderVo queryObjectByOrderSn(String orderSn) {
        return orderDao.queryObjectByOrderSn(orderSn);
    }

    public List<OrderVo> queryOrderList(Integer user_id) {
        return orderDao.queryOrderList(user_id);
    }

    public List<OrderVo> queryAdminOrderList(Integer user_id) {
        return orderDao.queryAdminOrderList(user_id);
    }

    public List<OrderVo> queryAllOrderByShopId(Integer shopId) {
        return orderDao.queryAllOrderByShopId(shopId);
    }

    public int create(CreatWxuserOrderDto order) {
        return orderDao.create(order);
    }

    public int createOrderGoods(CreateWxuserOrderGoodsDto orderGoods) {
        return orderDao.createOrderGoods(orderGoods);
    }

    public int cancel(String order_sn, Integer user_id) {
        return orderDao.cancel(order_sn, user_id);
    }

    public int shopCancel(String order_sn, Integer shopId) {
        return orderDao.shopCancel(order_sn, shopId);
    }

    public void delete(Integer id) {
        orderDao.delete(id);
    }

    public int updateSucc(OrderVo orderVo) {
        return orderDao.updateSucc(orderVo);
    }

    public int updatePayInfo(OrderVo orderVo){
        return orderDao.updatePayInfo(orderVo);
    }
}
